<style>
    #container {
        overflow: hidden;
        width: 100%;
        height: 100%;
        margin: 0;
        font-family: "微软雅黑";
    }
</style>

<div class="modal fade" id="seat" tabindex="-1" role="dialog" >
    <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel">地图轨迹</h4>
                </div>
                <div class="modal-body">                    
                    <div class="ckgj_pop_map">
                    	<div id="container"></div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-default" data-dismiss="modal">确定</button>
                        <?php include_once MvcReg::$_moduleName . '/views/layout/woody-prompt.php'; ?>
                    </div>
                </div>
            </div>

    </div>


</div>

<script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=awyKDc8f6V29IXEMtXgyZoa093ey7R7z"></script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=297ba6fa286c3af65142f0d2e6661af7"></script>
<script>
    'use strict';
    function seat_bd(lng,lat,shop_no,express_order_no,express_type,shop_express_no){
        if(!lat || !lng || !shop_no || !express_order_no || !express_type || !shop_express_no){
            $("#container").text('订单资料异常！');
            return false;
        }

        let info = {shop_no:shop_no,express_order_no:express_order_no,express_type:express_type,shop_express_no:shop_express_no};
        $.ajax({
            url:'?md=shop&cl=ajax&at=getLocation',
            type:'post',
            dataType:'json',
            data:info,
            success:function (d) {
                if(d.status == 'success'){
                    console.log('耗子尾汁');
                    var map = new BMapGL.Map('container');
                    var  elng = 121.320018;
                    var  elat = 31.193525;
                    map.centerAndZoom(new BMapGL.Point(d.data.exp_lng, d.data.exp_lat), 13);
                    map.enableScrollWheelZoom(true);

                    var marker1 = new BMapGL.Marker(new BMapGL.Point(d.data.slng, d.data.slat));
                    var myIcon2 = new BMapGL.Icon("webroot/file/imgs/car.png", new BMapGL.Size(52, 26));
                    var pt2 = new BMapGL.Point(d.data.exp_lng, d.data.exp_lat);
                    var marker2 = new BMapGL.Marker(pt2, {
                        icon: myIcon2
                    });
                    var marker3 = new BMapGL.Marker(new BMapGL.Point(lng, lat));


                    // 在地图上添加点标记
                    map.addOverlay(marker1);
                    map.addOverlay(marker2);
                    map.addOverlay(marker3);
                }else{
                    $("#container").text(d.msg);
                }
            }
        })
    }


    function seat_gd(lng,lat,shop_no,express_order_no,express_type,shop_express_no){
        if(!lat || !lng || !shop_no || !express_order_no || !express_type || !shop_express_no){
            $("#container").text('订单资料异常！');
            return false;
        }

        let info = {shop_no:shop_no,express_order_no:express_order_no,express_type:express_type,shop_express_no:shop_express_no};
        $.ajax({
            url:'?md=shop&cl=ajax&at=getLocation',
            type:'post',
            dataType:'json',
            data:info,
            success:function (d) {
                if(d.status == 'success'){
                    console.log('耗子尾汁');
                    var marker_gd1,marker_gd2,marker_gd3, map_gd = new AMap.Map("container", {
                        resizeEnable: true,
                        center: [d.data.exp_lng, d.data.exp_lat],
                        zoom: 13
                    });
                    marker_gd1 = new AMap.Marker({
                        icon: "/webroot/file/imgs/poi-marker-default_j.png",
                        position: [d.data.slng, d.data.slat],
                        offset: new AMap.Pixel(-13, -30)
                    });
                    marker_gd2 = new AMap.Marker({
                        icon: "webroot/file/imgs/car.png",
                        position: [d.data.exp_lng, d.data.exp_lat],
                        offset: new AMap.Pixel(-13, -30)
                    });
                    marker_gd3 = new AMap.Marker({
                        icon: "/webroot/file/imgs/poi-marker-default_s.png",
                        position: [lng,lat],
                        offset: new AMap.Pixel(-13, -30)
                    });
                    marker_gd1.setMap(map_gd);
                    marker_gd2.setMap(map_gd);
                    marker_gd3.setMap(map_gd);
                }else{
                    $("#container").text(d.msg);
                }
            }
        })
    }
</script>